var Mock = require('mockjs');

var Random = Mock.Random;

module.exports = function(imitator) {
    // 返回一个json
    imitator({
   		      url:'/json', 
   		      headers: {
            	"Access-Control-Allow-Origin": "*",
            	"Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept, Access-Token-User, Access-Token-Shop, Access-Token-User-2, Access-Token-Shop-2"
    //         	,
    //         	"Access-Token-Shop":"8736622f0701b168cb6d8769fc2f2516",
				// "Access-Token-User":"9cc98bc8a6af4360b0cc1b8d29e4e7af"
        	  },
    	      result:function(req, res){
    	      	var data = Mock.mock({
				    "result": 0,
				    "data": {
				        "nowOrigTotal|1-100": 0,
				        "beforeOrigTotal|1-40000": 39163.1200,
				        "percentOrigTotal|1-100": 100,
				        "nowPromotionCost|1-300": 0,
				        "beforePromotionCost|1-3000": 2770.0000,
				        "percentPromotionCost": 100,
				        "nowLastTotal": 0,
				        "beforeLastTotal": 8704.4000,
				        "percentLastTotal": 100,
				        "nowTcNum": 0,
				        "beforeTcNum": 485,
				        "percentTcNum": 0.0,
				        "nowOrderAc": 0,
				        "beforeOrderAc": 17.95,
				        "percentOrderAc": 100,
				        "nowGuestNum": 0,
				        "beforeGuestNum": 485,
				        "percentGuestNum": 100,
				        "nowPerCapita": 0,
				        "beforePerCapita": 17.95,
				        "percentPerCapita": null,
				        "nowDiscTotal": 0,
				        "beforeDiscTotal": 3006.0000,
				        "percentDiscTotal": 100,
				        "nowPresentMoney": 0,
				        "beforePresentMoney": -118.0000,
				        "percentPresentMoney": 100,
				        "nowWipeMoney": 0,
				        "beforeWipeMoney": -118.0000,
				        "percentWipeMoney": 100,
				        "nowSaleSum": 0,
				        "beforeSaleSum": 2770.0000,
				        "percentSaleSum": 100,
				        "marketingList": [{
				            "id": null,
				            "name": "合计",
				            "nowData": 0,
				            "beforeData": 1060.0000,
				            "percent": -100
				        }],
				        "payWayList": [{
				            "id": null,
				            "name": "合计",
				            "nowData": 0,
				            "beforeData": 51660.2500,
				            "percent": -100
				        }],
				        "saleTypeList": [{
				            "id": null,
				            "name": "合计",
				            "nowData": 0,
				            "beforeData": 8704.4000,
				            "percent": -100
				        }],
				        "nowCancelMoney": 0,
				        "beforeCancelMoney": -118.0000,
				        "percentCancelMoney": 100,
				        "nowFreeMoney": 0,
				        "beforeFreeMoney": -118.0000,
				        "percentFreeMoney": 100,
				        "itemClassList": [{
				            "id": "183800000000000015",
				            "name": "素汤",
				            "nowData": 0,
				            "beforeData": 16.0000,
				            "percent": -100
				        }, {
				            "id": "183800000000000074",
				            "name": "测试2",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }, {
				            "id": "183800000000000065",
				            "name": "快餐",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }, {
				            "id": "183800000000000052",
				            "name": "小吃",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }, {
				            "id": "183800000000000051",
				            "name": "甜品",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }, {
				            "id": "183800000000000055",
				            "name": "new1",
				            "nowData": 0,
				            "beforeData": 0.0000,
				            "percent": -100
				        }, {
				            "id": "183800000000100052",
				            "name": "其他",
				            "nowData": 0,
				            "beforeData": 33.0000,
				            "percent": -100
				        }, {
				            "id": "183800000000100053",
				            "name": "多单位",
				            "nowData": 0,
				            "beforeData": 114.0000,
				            "percent": -100
				        }, {
				            "id": "183800000000000054",
				            "name": "新分类",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }, {
				            "id": null,
				            "name": "合计",
				            "nowData": 0,
				            "beforeData": 163.0000,
				            "percent": -100
				        }],
				        "openingTimeList": [{
				            "id": "183800000000000101",
				            "name": "早市",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }, {
				            "id": null,
				            "name": "合计",
				            "nowData": 0,
				            "beforeData": 0,
				            "percent": -100
				        }],
				        "settlePosList": [{
				            "id": null,
				            "name": "合计",
				            "nowData": 0,
				            "beforeData": 8704.4000,
				            "percent": -100
				        }]
				    }
				});
        		res.send(data);
        	  }
            });
}